#include "LineNumberArea.h"

LineNumberArea::LineNumberArea(QWidget *parent) : QWidget(parent)
{
	this->lineNumberAreaWidth = 0;
	connect(this, SIGNAL(onPaint(QPaintEvent *)), parent, SLOT(lineNumberAreaPaintEvent(QPaintEvent *)));
	connect(parent, SIGNAL(changeLineNumberAreaWidth(int)), this, SLOT(onLineNumberAreaWidthChange(int)));
}

LineNumberArea::~LineNumberArea(void)
{
}

void LineNumberArea::onLineNumberAreaWidthChange(int w)
{
	this->lineNumberAreaWidth = w;
}

QSize LineNumberArea::sizeHint() const
{
	return QSize(lineNumberAreaWidth, 0);
}

void LineNumberArea::paintEvent(QPaintEvent *e)
{
	emit onPaint(e);
}

